<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru" lang="ru">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>iLocalStorage</title>
	<script type="text/javascript" src="../src/lib/swfobject.js"></script>
	<script type="text/javascript" src="../src/lib/json2.js"></script>
	<script type="text/javascript" src="../src/ilocalstorage.js"></script>
	<script type="text/javascript">
		iLocalStorage.setup({
			'engines': [iLocalStorage.ENGINE_COOKIE, iLocalStorage.ENGINE_FLASH],
			'defaultEngine': iLocalStorage.ENGINE_FLASH,
			'swfUrl': '../release/ilocalstorage.swf'
		});

		iLocalStorage.ready(function()
		{
			this.use(iLocalStorage.ENGINE_COOKIE);

			this.setup({
				'cookieDomain': '.' + location.hostname,
				'cookiePath': '/'
			});

			this.set('testText', 'text');

			var ns = 'namespace';
			this.set('testNamespace', true, ns);

			this.set('testBoolean', true);
			this.set('testNumber', 1234567890);
			this.set('testObject', {'propertyOne': 1, 'propertyTwo': 2});

			this.set('testRemove', true);
			this.remove('testRemove');

			if (!this.hasKey('isSetTestExpires'))
			{
				this.set('isSetTestExpires', true);
				var expires = +new Date + 10 * 1000; // 10 секунд
				this.set('testExpires', 1234567890, null, expires);
			}

			var value = this.get('testExpires');
			alert('value: ' + value + '\ntypeof: ' + typeof value);
		});
	</script>
</head>
<body>
</body>
</html>
